#ifndef EARTHDAWN_H
#define EARTHDAWN_H

#include "globals.h"

#include <QString>

namespace ed
{

enum __Attribute_value__
{
  Attr_DEX = 0,
  Attr_FOR = 1,
  Attr_CON = 2,
  Attr_PER = 3,
  Attr_VOL = 4,
  Attr_CHA = 5
};
class Attribute
{
private:
  static QVector<QString> STR;
  static QVector<__Attribute_value__> VALS;
  static void init();
  __Attribute_value__ _val;
public:
  typedef __Attribute_value__ Value;

  Attribute();
  Attribute(int value);
  Attribute(Value value);
  operator QString() const;
  operator Value() const;
  bool operator==(const Attribute& other) const;
  bool operator==(const Value &other) const { return _val == other; }
  bool operator<(const Attribute& other) const { return _val < other._val; }
  bool operator<(const Value& other) const { return _val < other; }
  static QList<Attribute> values();
  static Attribute fromString(const QString& str);
};

enum __Race_value__
{
  Race_Humain = 0,
  Race_Ork = 1,
  Race_Nain = 2,
  Race_Elfe = 3,
  Race_Obsidien = 4,
  Race_Sylphelin = 5,
  Race_Troll = 6,
  Race_Tskrang = 7
};
class Race
{
public:
  typedef __Race_value__ Value;
private:
  static QVector<QString> STR;
  static QVector<Value> VALS;
  static void init();
  __Race_value__ _val;
public:
  Race();
  Race(int value);
  Race(Value value);
  operator QString() const;
  operator Value() const;
  bool operator==(const Race& other) const;
  bool operator==(const Value& other) const;
  bool operator<(const Race& other) const { return _val < other._val; }
  bool operator<(const Value& other) const { return _val < other; }
  static QList<Race> values();
  static Race fromString(const QString& str);
};

enum __Die_value__
{
  Die_D4_2 = 0,
  Die_D4_1 = 1,
  Die_D4 = 2,
  Die_D6 = 3,
  Die_D8 = 4,
  Die_D10 = 5,
  Die_D12 = 6,
  Die_D20 = 7,
  Die_D100 = 8
};

class Die
{
public:
  typedef __Die_value__ Value;
private:
  static QVector<QString> STR;
  static QVector<Value> VALS;
  static void init();
  Value _val;
public:
  Die();
  Die(int value);
  Die(Value value);
  operator QString() const;
  operator Value() const;
  static QList<Die> values();
  static Die fromString(const QString& str);
  bool operator==(const Die& other) const;
  bool operator==(const Value &other) const { return _val == other; }
  bool operator<(const Die& other) const { return _val < other._val; }
  bool operator<(const Value& other) const { return _val < other; }
};
typedef QList<ed::Die> DicePool;
QString poolString(const DicePool& pool);

enum __Characteristic_value__
{
  Char_Initiative = 0,
  Char_PhysicalDefense = 1,
  Char_MagicDefense = 2,
  Char_SocialDefense = 3,
  Char_WalkSpeed = 4,
  Char_RunSpeed = 5,
  Char_CarryCapacity = 6,
  Char_LiftCapacity = 7,
  Char_Death = 8,
  Char_Uncounciousness = 9,
  Char_Injury = 10,
  Char_RecuperationCount = 11,
  Char_PhysicalArmor = 12,
  Char_MysticalArmor = 13,
  Char_FlightSpeed = 14,
  Char_FlightRunSpeed = 15
};
class Characteristic
{
public:
  typedef __Characteristic_value__ Value;
private:
  static QVector<QString> STR;
  static QVector<Value> VALS;
  static void init();
  Value _val;
public:
  Characteristic();
  Characteristic(int value);
  Characteristic(Value value);
  operator QString() const;
  operator Value() const;
  static QList<Characteristic> values();
  static Characteristic fromString(const QString& str);
  bool operator==(const Characteristic& other) const;
  bool operator==(const Value &other) const { return _val == other; }
  bool operator<(const Characteristic& other) const { return _val < other._val; }
  bool operator<(const Value& other) const { return _val < other; }
};

enum ResultDegree
{
  Pathetic = 0,
  Mediocre = 1,
  Average = 2,
  Good = 3,
  Excellent = 4,
  Extraordinary = 5
};

}

#endif // EARTHDAWN_H
